package com.yshkj.payment.controller.medicinal;

import com.yshkj.payment.dto.CommonJsonDto;
import com.yshkj.payment.dto.SpecSaleDto;
import com.yshkj.payment.dto.SpecSaleListDto;
import com.yshkj.payment.service.SpecService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * Created by 唐旭 on 2016/10/6.
 */
@RestController
@RequestMapping("/spec")
public class SpecController {

    @Autowired
    private SpecService specService;

    @RequestMapping("/code")
    @ResponseBody
    public SpecSaleListDto findSpec(@RequestParam String code) {
        return specService.findSpec(code);
    }

    @RequestMapping("/sale")
    @ResponseBody
    public CommonJsonDto saleSpecList(@RequestBody List<SpecSaleDto> list) {
        return specService.saleSpecList(list);
    }
}
